/////////////////////////////////////////////////////////////////////////////
// Name:        ttsspeechsettingspanel.h
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     19/02/2009 07:08:51
// RCS-ID:      
// Copyright:   (c) Anthemion Software Limited
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _TTSSPEECHSETTINGSPANEL_H_
#define _TTSSPEECHSETTINGSPANEL_H_

/*
 * Includes
 */

////@begin includes
#include "wx/hyperlink.h"
#include "wx/valgen.h"
#include "wx/spinctrl.h"
////@end includes

#include "tts/tts.h"

/*
 * Forward declarations
 */

////@begin forward declarations
class wxBoxSizer;
class wxHyperlinkCtrl;
class wxSpinCtrl;
////@end forward declarations

/*
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_WXTTSSPEECHSETTINGSPANEL_STYLE wxTAB_TRAVERSAL
#define SYMBOL_WXTTSSPEECHSETTINGSPANEL_TITLE wxEmptyString
#define SYMBOL_WXTTSSPEECHSETTINGSPANEL_IDNAME ID_WXTTSSPEECHSETTINGSPANEL
#define SYMBOL_WXTTSSPEECHSETTINGSPANEL_SIZE wxSize(400, 300)
#define SYMBOL_WXTTSSPEECHSETTINGSPANEL_POSITION wxDefaultPosition
////@end control identifiers

/**
    @class wxTTSSpeechSettingsPanel

    @category{tts}
 */

class wxTTSSpeechSettingsPanel: public wxPanel
{    
    DECLARE_DYNAMIC_CLASS( wxTTSSpeechSettingsPanel )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    wxTTSSpeechSettingsPanel();
    wxTTSSpeechSettingsPanel( wxWindow* parent, wxWindowID id = SYMBOL_WXTTSSPEECHSETTINGSPANEL_IDNAME, const wxPoint& pos = SYMBOL_WXTTSSPEECHSETTINGSPANEL_POSITION, const wxSize& size = SYMBOL_WXTTSSPEECHSETTINGSPANEL_SIZE, long style = SYMBOL_WXTTSSPEECHSETTINGSPANEL_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXTTSSPEECHSETTINGSPANEL_IDNAME, const wxPoint& pos = SYMBOL_WXTTSSPEECHSETTINGSPANEL_POSITION, const wxSize& size = SYMBOL_WXTTSSPEECHSETTINGSPANEL_SIZE, long style = SYMBOL_WXTTSSPEECHSETTINGSPANEL_STYLE );

    /// Destructor
    ~wxTTSSpeechSettingsPanel();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

    /// Apply information
    void ApplyInfo(wxTTSSpeechSettingsInfo& info);

    /// Set info
    void SetInfo(const wxTTSSpeechSettingsInfo& info) { m_info = info; ApplyInfo(m_info); }

    /// Get info
    const wxTTSSpeechSettingsInfo& GetInfo() const { return m_info; }

    /// Data transfer
    virtual bool TransferDataToWindow();
    virtual bool TransferDataFromWindow();

    /// Set/get tooltip show flag
    static void SetShowToolTips(bool show) { m_showToolTips = show; }
    static bool GetShowToolTips() { return m_showToolTips; }

////@begin wxTTSSpeechSettingsPanel event handler declarations

    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_APPLICATION_PREFERENCES_ENGINE
    void OnApplicationPreferencesEngineSelected( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_ENGINE_PROGRAM_LOCATION
    void OnApplicationPreferencesEngineProgramLocationUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLICATION_PREFERENCES_BROWSE_ENGINE_PROGRAM_LOCATION
    void OnApplicationPreferencesBrowseEngineProgramLocationClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_BROWSE_ENGINE_PROGRAM_LOCATION
    void OnApplicationPreferencesBrowseEngineProgramLocationUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_ENGINE_DATA_FOLDER
    void OnApplicationPreferencesEngineDataFolderUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLICATION_PREFERENCES_BROWSE_ESPEAK_DATA_FOLDER
    void OnApplicationPreferencesBrowseEspeakDataFolderClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_BROWSE_ESPEAK_DATA_FOLDER
    void OnApplicationPreferencesBrowseEspeakDataFolderUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_ESPEAK_VOICE
    void OnApplicationPreferencesEspeakVoiceUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_ESPEAK_VOICE_VARIANT
    void OnApplicationPreferencesEspeakVoiceVariantUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_SPEECH_SPEED
    void OnApplicationPreferencesSpeechSpeedUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_SPEECH_VOLUME
    void OnApplicationPreferencesSpeechVolumeUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_APPLICATION_PREFERENCES_SPEECH_PITCH
    void OnApplicationPreferencesSpeechPitchUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLICATION_PREFERENCES_TEST_SPEECH
    void OnApplicationPreferencesTestSpeechClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLICATION_PREFERENCES_EDIT_PRONUNCIATIONS
    void OnApplicationPreferencesEditPronunciationsClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLICATION_PREFERENCES_RESET_SPEECH_SETTINGS
    void OnApplicationPreferencesResetSpeechSettingsClick( wxCommandEvent& event );

////@end wxTTSSpeechSettingsPanel event handler declarations

////@begin wxTTSSpeechSettingsPanel member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end wxTTSSpeechSettingsPanel member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin wxTTSSpeechSettingsPanel member variables
    wxBoxSizer* m_innerSizer;
    wxChoice* m_speechEngineCtrl;
    wxHyperlinkCtrl* m_urlCtrl;
    wxTextCtrl* m_engineProgramLocation;
    wxTextCtrl* m_engineDataFolder;
    wxComboBox* m_speechVoice;
    wxComboBox* m_speechVoiceVariant;
    wxSpinCtrl* m_speechSpeed;
    wxSpinCtrl* m_speechVolume;
    wxSpinCtrl* m_speechPitch;
    wxTextCtrl* m_speechTestText;
    wxBoxSizer* m_buttonGroupSizer;
    wxButton* m_testSpeechCtrl;
    wxButton* m_editCustomPronunciationsCtrl;
    wxButton* m_resetSpeechSettingsCtrl;
    /// Control identifiers
    enum {
        ID_WXTTSSPEECHSETTINGSPANEL = 13001,
        ID_APPLICATION_PREFERENCES_ENGINE = 13002,
        ID_APPLICATION_PREFERENCES_GET_ESPEAK = 13003,
        ID_APPLICATION_PREFERENCES_ENGINE_PROGRAM_LOCATION = 13004,
        ID_APPLICATION_PREFERENCES_BROWSE_ENGINE_PROGRAM_LOCATION = 13005,
        ID_APPLICATION_PREFERENCES_ENGINE_DATA_FOLDER = 13006,
        ID_APPLICATION_PREFERENCES_BROWSE_ESPEAK_DATA_FOLDER = 13007,
        ID_APPLICATION_PREFERENCES_ESPEAK_VOICE = 13008,
        ID_APPLICATION_PREFERENCES_ESPEAK_VOICE_VARIANT = 13009,
        ID_APPLICATION_PREFERENCES_SPEECH_SPEED = 13010,
        ID_APPLICATION_PREFERENCES_SPEECH_VOLUME = 13011,
        ID_APPLICATION_PREFERENCES_SPEECH_PITCH = 13012,
        ID_APPLICATION_PREFERENCES_SPEECH_TEST_TEXT = 13013,
        ID_APPLICATION_PREFERENCES_TEST_SPEECH = 13014,
        ID_APPLICATION_PREFERENCES_EDIT_PRONUNCIATIONS = 13015,
        ID_APPLICATION_PREFERENCES_RESET_SPEECH_SETTINGS = 13016
    };
////@end wxTTSSpeechSettingsPanel member variables

    wxTTSSpeechSettingsInfo m_info;
    bool                    m_ignoreEvents;
    static bool             m_showToolTips;
};

#endif
    // _TTSSPEECHSETTINGSPANEL_H_
